Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRIMUS_output.log not always being created #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

jtb324
Copy link

@jtb324 jtb324 commented Sep 13, 2024

Issue:


On several of my PRIMUS runs, the PRIMUS_output.log file was not being created. My runs were failing (for other reasons on my part) and I was hoping I could look at the log file but it was never made. I realized this issue was occurring only when I would rerun primus without removing the output directory from the previous run.

Explanation :


I think what is happening is that when PRIMUS renames the previous output directory, the $LOG filehandle gets shut accidentally and then there is no where but stdout for the logging messages to go to. This would also explain the several warning messages that I was receiving about writing to a closed file see issue #1.

Code change:


This code moves the part of primus_kickoff7.pl that checks for the previous output directory (previous lines 129-132) to lines 121-124 above the open($LOG, ...) statement. Then I added additional code to create the output directory if it doesn't already exist to line 126. I'm sure that line 126 introduces redundancy but the if statement makes sure that it will not try to recreate an already existing directory. This change ensures that the output directory is made and fixes issue #1

…his was because if the directory was already made then PRIMUS was not recreating the new directory in time after renaming the previous directory to *_OLD. This error was causing the open statement at lien 128 to not correctly create the filehandle
@jtb324 jtb324 added the bug Something isn't working label Sep 13, 2024
@jtb324 jtb324 requested a review from washedgram September 13, 2024 19:44
@jtb324 jtb324 linked an issue Sep 13, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PRIMUS_output.log accidentally being deleted during pre-PRIMUS step
1 participant